<style>
.unit label{
	width:125px;
}
</style>
<script type="text/javascript">
function dialogAjaxDone1(json){
	DWZ.ajaxDone(json);
	if (json.statusCode == DWZ.statusCode.ok){
		if (json.navTabId){
			navTab.reload(json.forwardUrl, {navTabId: json.navTabId});
		} else if (json.rel) {
			var $pagerForm = $("#pagerForm", navTab.getCurrentPanel());
			var args = $pagerForm.size()>0 ? $pagerForm.serializeArray() : {}
			navTabPageBreak(args, json.rel);
		}
		if ("closeCurrent" == json.callbackType) {
			$.pdialog.close('goods');
			$.pdialog.open('__URL__/edit/id/'+{$vo.id},'businessEdit',"修改业务", { max:false, mask:true, width: 540, height: 320});
			//
		}
	}
}
function dialogAjaxDone2(json){
	DWZ.ajaxDone(json);
	if (json.statusCode == DWZ.statusCode.ok){
			$.pdialog.open('__URL__/edit/id/'+{$vo.id},'businessEdit',"修改业务", { max:false, mask:true, width: 540, height: 320});
		
	}
}
</script>
<div class="pageContent">
	<form method="post" action="__URL__/update/navTabId/__MODULE__/callbackType/closeCurrent" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
	    <input type="hidden" name="userid" value="<?php echo $_SESSION[C('USER_AUTH_KEY')] ?>">
		<input type="hidden" name="id" value="{$vo.id}" >
		<div class="pageFormContent" layoutH="170">
			<div class="unit">
				<label>公司名称：</label>
				<input name="companyname" type="text" class="required" value="{$vo.companyname}" style="width: 361px;"/>
			</div>
			<div class="unit">
				<label>地址：</label>
				<input type="text" name="address" value="{$vo.address}" style="width: 361px;"/>
			</div>
			<div class="unit">
				<label>联系人：</label>
				<input name="linkname" class="required" type="text" value="{$vo.linkname}"/>
			</div>
			<div class="unit">
				<label>电话：</label>
				<input type="text" name="phone" class="phone" value="{$vo.phone}"/>		
			</div>
			
			<!-- <div class="unit">
				<label>购买意向：</label>
				<input name="purchaseintention" type="text" value="{$vo.purchaseintention}"/>
			</div> 
			
			<div class="unit">
				<label>购买产品名称：</label>
				<input name="productname" type="text" value="{$vo.productname}"/>
			</div>
			
			<div class="unit">
				<label>产品单价/吨：</label>
				<input name="unit" type="text" value="{$vo.unit}"/>
			</div>
			<div class="unit">
				<label>购买数量：</label>
				<input type="text" name="quantity" class="digits" value="{$vo.quantity}"/>
			</div>-->
			<div class="unit">
				<label>供货周期：</label>
				<input type="text" name="leadtime" value="{$vo.leadtime}"/>
			</div>
			<div class="unit">
				<label style="margin-right: -10px;">业务类型：</label>
				<select name="type" id="type" class="combox">
					<option value="购进合同" <eq name="vo.type" value="购进合同">selected</eq>>购进业务</option>
					<option value="销售合同" <eq name="vo.type" value="销售合同">selected</eq>>销售业务</option>
				</select>
			</div>
			<div class="unit">
				<label>查看人姓名：</label>
				<input type="text" name="viewnames" value="{$vo.viewnames}" readonly/>
			</div>
			<div class="unit">
				<label>备注：</label>
				<textarea name="note" cols="58" style="width: 361px;" rows="3">{$vo.note}</textarea>
			</div>
			
			<table class="table" width="100%">
			           <thead>
							<tr>
							 <th>商品名称</th>
			                 <th>购买数量</th>
			                 <th>产品单价/吨</th>
			                 <th>金额</th>
		                     <th type="del" width="60">操作</th>
		                    </tr>
						</thead>
					<tbody>
						<volist id="con" name="bg">
						<tr target="sid_node" rel="{$con['id']}">
						<td>{$con['goodname']}</td>
						<td>{$con['quality']}</td>
						<td>{$con['price']}</td>
						<td>{$con['totalprice']}</td>
						<td><a href="__URL__/goodsedit/id/{$con['id']}" target="dialog" rel="goods" mask="true" title="修改商品信息"  width="500" height="200">修改</a> | <a href="__URL__/goodsdel/id/{$con['id']}" target="ajaxTodo" callback="dialogAjaxDone2" >删除</a></td>
						</tr>
						</volist>
					</tbody>
			</table>		
		</div>
			<div width="100%"  layoutH="250">
		<table class="list nowrap itemDetail" addButton="新增商品" width="100%">
						<thead>
							<tr>
							 <th type="lookup" name="items.org.goodname[#index#]" lookupGroup="items.org"   suggestFields="goodid,goodname"   lookupUrl="__URL__/getgoods" lookupPk="goodid"  size="12"  >商品名称</th>
			                 <th type="text" name="items.itemQuality[#index#]" size="12" fieldClass="number" >购买数量</th>
			                 <th type="text" name="items.itemPrice[#index#]" size="12" fieldClass="number"  >产品单价/吨</th>
			                 <th type="text" name="items.itemTotalprice[#index#]" size="12" fieldClass="number"  >金额</th>
		                     <th type="del" width="60">操作</th>
		                    </tr>
						</thead>
						<tbody>
						</tbody>
			</table>
		</div>
		<div class="formBar">
			<ul>
				<!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>
